package com.fresh.fresh.service.lmpI;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fresh.fresh.dao.Cart;
import com.fresh.fresh.mapper.CartMapper;
import com.fresh.fresh.service.CartService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements CartService {
    @Override
    public List<Cart> list(Integer id) {
        return this.baseMapper.list(id);
    }

    @Override
    public Integer deleteCommodity(Integer commodityId) {
        return this.baseMapper.deleteById(commodityId);
    }

    @Override
    public void addShopping(Cart shopping) {
        this.baseMapper.insert(shopping);
    }

    @Override
    public List<Cart> getShopping(Integer userId, Integer commodityId) {
      return  this.baseMapper.getShopping(userId,commodityId);
    }




}
